package phoenix.web.test_suites.naughtyfever.critical;

import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

import phoenix.core.base.TestSuiteBase;
import phoenix.core.data_models.TestUserDataModel;
import phoenix.core.data_models.UserProfileDataModel;
import phoenix.core.data_models.UserProfileDataModel.AboutMe;
import phoenix.web.test_objects.BackendTests;
import phoenix.web.test_objects.FunnelTests;
import phoenix.web.test_objects.PaymentRedirectionsTests;
import phoenix.web.test_objects.RegistrationTests;

public class PaymentRedirectionTS extends TestSuiteBase
{
	private final RegistrationTests registrationTests = new RegistrationTests(phoenix);
	private final BackendTests backendTests = new BackendTests(phoenix);
	private final FunnelTests funnelTests = new FunnelTests(phoenix);
	private final PaymentRedirectionsTests paymentRedirectionsTests = new PaymentRedirectionsTests(phoenix);

	@DataProvider
	public Object[][] registrationDataMale()
	{
		return registrationTests.dataProviders.registrationDataMale();
	}

	@DataProvider
	public Object[][] funnelData()
	{
		return funnelTests.dataProviders.funnelData();
	}

	@DataProvider
	public Object[][] paymentRedirectionsPhotosData()
	{
		return paymentRedirectionsTests.dataProviders.paymentRedirectionsPhotosData();
	}

	@DataProvider
	public Object[][] paymentRedirectionsFeaturesData()
	{
		return paymentRedirectionsTests.dataProviders.paymentRedirectionsFeaturesData();
	}

	@Test(dataProvider = "registrationDataMale", priority = 1, enabled = true)
	public void registrationMaleTest(String p_userGender, String p_userEmail, String p_userPassword, String p_userBirthDay, String p_userBirthMonth,
			String p_userBirthYear)
	{
		registrationTests.registrationTest(p_userGender, p_userEmail, p_userPassword, p_userBirthDay, p_userBirthMonth, p_userBirthYear);
	}

	@Test(dependsOnMethods = { "registrationMaleTest" }, priority = 2, enabled = true)
	public void getUserDataTest()
	{
		backendTests.getUserDataTest(testUser().getEmail());
	}

	@Test(dependsOnMethods = { "getUserDataTest" }, priority = 3, enabled = true)
	public void confirmationTest()
	{
		funnelTests.confirmationTest();
	}

	@Test(dependsOnMethods = { "confirmationTest" }, dataProvider = "funnelData", groups = { "funnel" }, priority = 4, enabled = true)
	public void funnelMaleTest(String p_screenName, UserProfileDataModel.LookingFor p_lookingForParams, AboutMe
			p_aboutMeParams)
	{
		funnelTests.funnelTest(p_screenName, p_lookingForParams, p_aboutMeParams);
	}

	@Test(dependsOnMethods = { "confirmationTest" }, dataProvider = "paymentRedirectionsPhotosData", groups = { "freeRedirects" }, priority = 5, enabled = true)
	public void redirectsLookingForUpgradeBannerTest(TestUserDataModel p_userRecipient)
	{
		paymentRedirectionsTests.lookingForUpgradeBannerTest(p_userRecipient);
	}

	@Test(dependsOnMethods = { "confirmationTest" }, dataProvider = "paymentRedirectionsPhotosData", groups = { "freeRedirects" }, priority = 6, enabled = true)
	public void redirectsFullSizePrimaryPhotoTest(TestUserDataModel p_userRecipient)
	{
		paymentRedirectionsTests.fullSizePrimaryPhotoTest(p_userRecipient);
	}

	@Test(dependsOnMethods = { "confirmationTest" }, dataProvider = "paymentRedirectionsPhotosData", groups = { "freeRedirects" }, priority = 7, enabled = true)
	public void redirectsFullSizeAdditionalPhotoTest(TestUserDataModel p_userRecipient)
	{
		paymentRedirectionsTests.fullSizeAdditionalPhotoTest(p_userRecipient);
	}

	// siteBug: https://redmine.platformphoenix.com/issues/138391: User profile: block photo: features icons isn't displayed
	@Test(dependsOnMethods = { "confirmationTest" }, dataProvider = "paymentRedirectionsFeaturesData", groups = { "freeRedirects" }, priority = 8, enabled = false)
	public void redirectsFreeCommunicationIconTest(TestUserDataModel p_userFeatures, TestUserDataModel p_userHot)
	{
		paymentRedirectionsTests.freeCommunicationIconTest(p_userFeatures);
	}

	// siteBug: https://redmine.platformphoenix.com/issues/138391: User profile: block photo: features icons isn't displayed
	@Test(dependsOnMethods = { "confirmationTest" }, dataProvider = "paymentRedirectionsFeaturesData", groups = { "freeRedirects" }, priority = 9, enabled = false)
	public void redirectsInvisibleModeIconTest(TestUserDataModel p_userFeatures, TestUserDataModel p_userHot)
	{
		paymentRedirectionsTests.invisibleModeIconTest(p_userFeatures);
	}

	// siteBug: https://redmine.platformphoenix.com/issues/138391: User profile: block photo: features icons isn't displayed
	@Test(dependsOnMethods = { "confirmationTest" }, dataProvider = "paymentRedirectionsFeaturesData", groups = { "freeRedirects" }, priority = 10, enabled = false)
	public void redirectsVipInSearchIconTest(TestUserDataModel p_userFeatures, TestUserDataModel p_userHot)
	{
		paymentRedirectionsTests.vipInSearchIconTest(p_userFeatures);
	}

	// siteBug: https://redmine.platformphoenix.com/issues/138391: User profile: block photo: features icons isn't displayed
	@Test(dependsOnMethods = { "confirmationTest" }, dataProvider = "paymentRedirectionsFeaturesData", groups = { "freeRedirects" }, priority = 11, enabled = false)
	public void redirectsHotUserIconTest(TestUserDataModel p_userFeatures, TestUserDataModel p_userHot)
	{
		paymentRedirectionsTests.hotUserIconTest(p_userHot);
	}

	@Test(dependsOnMethods = { "confirmationTest" }, groups = { "freeRedirects" }, priority = 12, enabled = true)
	public void redirectsSearchOnlineBannerUpgradeTest()
	{
		paymentRedirectionsTests.searchOnlineBannerUpgradeTest();
	}

	@Test(dependsOnMethods = { "confirmationTest" }, groups = { "freeRedirects" }, priority = 13, enabled = true)
	public void redirectsSearchNearBannerUpgradeTest()
	{
		paymentRedirectionsTests.searchNearBannerUpgradeTest();
	}

	@Test(dependsOnMethods = { "confirmationTest" }, groups = { "freeRedirects" }, priority = 14, enabled = true)
	public void redirectsSearchRecentlyBannerUpgradeTest()
	{
		paymentRedirectionsTests.searchRecentlyBannerUpgradeTest();
	}

	@Test(dependsOnMethods = { "confirmationTest" }, groups = { "freeRedirects" }, priority = 15, enabled = true)
	public void redirectsMyAccountButtonUpgradeTest()
	{
		paymentRedirectionsTests.buttonUpgradeTest();
	}

	@Test(dependsOnMethods = { "confirmationTest" }, priority = 16, enabled = true)
	public void makeUserPaid()
	{
		backendTests.makeUserPaid(testUser());
	}

	// siteBug: https://redmine.platformphoenix.com/issues/138391: User profile: block photo: features icons isn't displayed
	@Test(dependsOnMethods = { "makeUserPaid" }, dataProvider = "paymentRedirectionsFeaturesData", groups = { "paidRedirects" }, priority = 17, enabled = false)
	public void redirectsPaidFreeCommunicationIconTest(TestUserDataModel p_userFeatures, TestUserDataModel p_userHot)
	{
		paymentRedirectionsTests.freeCommunicationIconTest(p_userFeatures);
	}

	// siteBug: https://redmine.platformphoenix.com/issues/138391: User profile: block photo: features icons isn't displayed
	@Test(dependsOnMethods = { "makeUserPaid" }, dataProvider = "paymentRedirectionsFeaturesData", groups = { "paidRedirects" }, priority = 18, enabled = false)
	public void redirectsPaidInvisibleModeIconTest(TestUserDataModel p_userFeatures, TestUserDataModel p_userHot)
	{
		paymentRedirectionsTests.invisibleModeIconTest(p_userFeatures);
	}

	// siteBug: https://redmine.platformphoenix.com/issues/138391: User profile: block photo: features icons isn't displayed
	@Test(dependsOnMethods = { "makeUserPaid" }, dataProvider = "paymentRedirectionsFeaturesData", groups = { "paidRedirects" }, priority = 19, enabled = false)
	public void redirectsPaidVipInSearchIconTest(TestUserDataModel p_userFeatures, TestUserDataModel p_userHot)
	{
		paymentRedirectionsTests.vipInSearchIconTest(p_userFeatures);
	}

	@Test(dependsOnMethods = { "makeUserPaid" }, priority = 20, groups = { "paidRedirects" }, enabled = true)
	public void redirectsPaidMyAccountButtonUpgradeTest()
	{
		paymentRedirectionsTests.buttonUpgradeTest();
	}
}